//
//  PhotoUtil.h
//  photo_kit
//
//  Created by Bq Lin on 2020/9/10.
//

#import <Foundation/Foundation.h>
#import <Photos/Photos.h>

#define kIdentity @"identity"
#define kWidth @"width"
#define kHeight @"height"

NS_INLINE NSMutableArray *
ArrayMap(NSArray *input, id (^transform)(id item)) {
    if (!transform) {
        return [input mutableCopy];
    }
    
    NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:input.count];
    for (NSInteger i = 0; i < input.count; i++) {
        [result addObject:transform(input[i])];
    }
    return result;
}

@interface PhotoUtil : NSObject

+ (NSDictionary *)dictionaryForPHAsset:(PHAsset *)asset;

@end
